using HCore.Tests.Runtime.ShootingEditor2D.Scripts.Command;
using HCore.Tests.Runtime.ShootingEditor2D.Scripts.Support;
using UnityEngine;

namespace HCore.Tests.Runtime.ShootingEditor2D.Scripts.ViewController.GamePlay
{
    public class AttackPlayer : HCoreCommandMonoBehaviour
    {
        [SerializeField] public int Hurt = 1;

        private void OnCollisionEnter2D(Collision2D other)
        {
            if (other.gameObject.CompareTag("Player")) SendCommand(new HurtPlayerCommand(Hurt));
        }
    }
}